﻿using System;
using System.Data;
using System.Collections.Generic;

namespace ZHDJ.MobileInterface
{
    public partial class ATMMassage : AbstractBasePage
    {
        protected override OutParam BusinessProcess<InParam, OutParam>(InParam inParam)
        {
            // 业务逻辑返回的响应对象  
            ATMMassageOutParam result = new ATMMassageOutParam();
            ATMMassageInParam param = new ATMMassageInParam();
            string logMsg = "";
            bool isFlag = true;

            try
            {
                param = inParam as ATMMassageInParam;
                
                if (isFlag)
                {
                    result.Massage = "爱心柜员机通过 “存入—申请—取出”方式实现全区范围内的爱心帮扶。党员可以通过“我要捐助”、“定向捐助”将人力资源、物资资源存入爱心柜员机。需要帮助的党员可以通过“我要求助”将自己的需要存入爱心柜员机。爱心柜员机将捐助与求助信息自动匹配，及时的将收到的爱心物资传递给社区内有需要的党员。欢迎您在这里献出自己的爱心，也希望你能够在这里得到我们的帮助。";
                }

                logMsg = result.desc;
            }
            catch (Exception ex)
            {
                result.code = "0";
                result.desc = "操作异常，多次出现请联系管理员";
                logMsg = ex.Message + ":" + ex.StackTrace;
            }

            CommonUtils.InsertMobileInterfaceLog(SystemCode + "-GetATMMassageNotice", SerializeHelper.JsonSerializer<ATMMassageInParam>(param), logMsg);
            return result as OutParam;
        }

        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (string.Compare(Request.QueryString["Safe"], "False", true) == 0)
                ProcessRequest<ATMMassageInParam, ATMMassageOutParam>();
            else
                SafeProcessRequest<ATMMassageInParam, ATMMassageOutParam>();
        }
    }

    #region 请求参数
    public class ATMMassageInParam
    {
    }
    #endregion


    #region 结果参数
    public class ATMMassageOutParam
    {
        public ATMMassageOutParam()
        {
            code = "1";
            desc = "操作成功";
        }

        public string code
        { get; set; }

        public string desc
        { get; set; }

        public string Massage
        { get; set; }
    } 
    #endregion
}